package org.uva.streambuilder;

import java.awt.*;
import javax.swing.*;

public class BuilderApplet extends JApplet {
/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

public static void main(String s[])
{
    // Set cross-platform Java L&F (also called "Metal")
    try {
	    // Set System L&F
        UIManager.setLookAndFeel(
            UIManager.getSystemLookAndFeelClassName());
        UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");

    } 
    catch (UnsupportedLookAndFeelException e) {
       // handle exception
    }
    catch (ClassNotFoundException e) {
       // handle exception
    }
    catch (InstantiationException e) {
       // handle exception
    }
    catch (IllegalAccessException e) {
       // handle exception
    }


	JFrame frame = new JFrame();
	frame.setTitle("StreamBuilder");
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	JApplet applet = new BuilderApplet();
	applet.init();
	frame.add(applet);
	frame.pack();
	frame.setVisible(true);
}

public void init()
{
	
	
	BuilderPanel panel = new BuilderPanel();
	Container cp = getContentPane();
	cp.setLayout(new BorderLayout());
	cp.add(panel, BorderLayout.CENTER);
	JPanel toolbar = new ToolbarPanel();
	cp.add(toolbar, BorderLayout.EAST);
        
	
        JScrollPane scroller = new JScrollPane(panel);
        scroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
                
        cp.add(scroller);
	
	JPanel searchBar = new JPanel();
	searchBar.setBorder(BorderFactory.createRaisedBevelBorder());
	JButton searchButton = new JButton("Search");
	JTextField searchquery = new JTextField(40);
	searchquery.setToolTipText("Enter your stream tags here");
	searchBar.add(searchquery);
	searchBar.add(searchButton);
	
	
	cp.add(searchBar, BorderLayout.SOUTH);
	
	
}
	
}
